Skip to content

feat(detail): the record header's stage menu asks for the fields a stage needs through the shared fill-in dialog - #36032

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-9k8n3l
Nov 21, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-9k8n3l

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

repo:objectstack#1 · os-sales · session_01L6bhgWV6ouxRg2fByapa6F

Fixes #35956
(PR 2 of 2. PR 1 #35994, merged 9a98a467, made the pre-check and the dialog shared and wired the list cell, the record page's inline Save and the kanban drop. This PR moves the last surface, the record header's stage menu, onto them and deletes its own copy. The record drawer's per-field save is #35995, its own card, not in this card's acceptance.)

Clause-②: no
Metadata-protocol: none
Skills-docs: none. No skill under skills/ and no page under content/docs/ describes the stage menu's dialog.
Flow: dev-thread rule (maintainer 2026-11-20 09:22:50Z): the card thread builds itself; L1 by L1-a. The seat's claim names no L2 while Clause-② stays no.

维护者速读

  • 记录页头部的阶段下拉(记录名旁边那个带小箭头的状态标签),现在和列表单元格、记录页行内保存、看板拖动用的是同一个补填框,仓库里只剩一份预判和一个框。
  • 选一个会让空字段变必填的阶段(例如把项目改成「已完成」,而「完成说明」此时必填):框里先是记录名,再是「状态:已完成」(只读),下面列出要补的字段。不填点「移动」,字段下面显示「必填」,什么都不写;补填的值又让别的字段变必填时,框里马上追加;填好点「移动」,阶段和补填的值一次写入;点「取消」什么都不写,标签还是原来的阶段。
  • 选一个什么都不需要补的阶段:弹出的也是这个框,只有记录名和「状态:X」,焦点在「移动」上,按回车就确认(和原来一样)。
  • 服务端仍然拒绝时框不关:说的是框里的字段就显示在它下面;说的是另一个能填的字段就把它加进框里;别人刚改过这条记录,框底提示「已显示最新版本」并重新读取;其他原因(无权限等)在框底用原来的那句话。
  • 和以前不同的一点:富文本、文件、公式这类不能就地编辑的字段,以前的阶段菜单不检查字段能不能就地编辑(读代码所得,未实测),现在和其它几处一样不问,直接走服务端的拒绝提示(卡第 6 项)。
  • 不变的:记录页里的阶段条(record:path)的确认框原样保留。
  • 需要你决定的:无。

What changes

The stage menu on the shared pair (@object-ui/plugin-detail, renderers/recordPathStageChange.tsx, useStageChange with collectFields, which only RecordStageMenu turns on):

  • Which fields a pick asks for is now collectRequiredWhenPromptFields(objectFields, record, { [statusField]: value }, { fillable }) from @object-ui/fields, the evaluator PR 1 shared. The menu's own fieldsNeededAt loop over resolveFieldRuleState is deleted. fillable is the question the menu already asked (not the stage field, not read-only, computed or a system field, the reader's recordEdit grant), the same one InlineEditSaveBar asks.
  • The dialog is RequiredFieldsDialog. The menu's own field form (InlineFieldInput rows, data-stage-change-field*), its refusal routing and confirmWithFields are deleted. The menu passes the record's name (getRecordDisplayName), one change row (the stage field's label and the picked stage's label), moreFields for chained requirements, refusalField (a field the refusal names that the reader may fill and that has an in-place editor), and its own title, description and 移动 label, which are the strings it used before (detail.pathStageChangeTitle, detail.stageMenuFieldsDescription / detail.pathStageChangeDescription, detail.pathStageChangeConfirm). No new string.
  • Every pick opens this dialog, including a stage that makes nothing required. It is then the move's confirmation, with no rows to fill. This keeps one dialog and one refusal path: a refusal that names a fillable field adds that field, as the old form did.
  • The write is still one updateVia with { ...typedValues, [statusField]: value } and ifMatch set to the record's updated_at, then a re-read. On a rejection, a refusal that names fields goes to the dialog as it came. Every other refusal becomes the menu's own line from stageRefusalLines, which is unchanged: a 409 re-reads the record and says so, a permission refusal reads the stage line and never the raw 403, an external source reads the read-only line. That line goes to the dialog's foot. The stage does not move.
  • record:path (collectFields off) keeps its AlertDialog confirmation and its refusal under the rail, unchanged.

The shared dialog, one behaviour (@object-ui/fields, RequiredFieldsDialog). When it opens with no field to fill, its submit button takes the focus instead of Radix's first tabbable (Cancel), so Enter confirms the change the reader just picked. This is the #35891 keyboard contract the stage menu's AlertDialog carried. With fields, the first field still takes the focus as before. No prop changed. The other hosts open it only with fields, so they see no difference.

Acceptance notes

The card's acceptance items, as they stand after both PRs:

  • List cell, record page inline, kanban drop: PR 1.
  • Header stage switch to the stage that needs B: the dialog opens and B can be filled: this PR (tests and browser below).
  • Chained C: this PR's tests and browser for the stage menu; PR 1 for the other surfaces.
  • B already has a value: not asked (the shared collector's stored-value skip, requiredWhenPrompt.test.ts). B is rich text: not asked, and the refusal reads in the dialog's foot (test and browser below). The list's 「打开记录」 link was delivered by S1 feat(list): a list cell saves the moment it is committed, and Space types into the selected cell #35864 (PR 1's item 7).
  • A refusal while the dialog is open: it stays and says why (a 409 test here; PR 1 for the other surfaces).
  • 375 px: browser below.
  • "Only one pre-check and one dialog remain in the repository": recordPathStageChange.tsx no longer reads resolveFieldRuleState, isMissingForRequired or InlineFieldInput. Its fieldsNeededAt is now one call of the shared collector. confirmWithFields and the data-stage-change-field* rows are gone; the only remaining mention is the migrated test asserting their absence. collectRequiredWhenPromptFields and RequiredFieldsDialog are defined only in ui/packages/fields/src/.

Readings I chose (seat claim, items 1–3):

  1. Every pick from the header menu opens the shared dialog, including a stage that needs nothing. Two dialogs that hand over to each other on a refusal would be the second copy this card removes.
  2. A 409 keeps the menu's own line and re-read, the behaviour 记录页默认页不再画阶段条和顶部关键字段条;阶段改成记录名旁的状态标签,点开下拉切换(图 41) #35891 shipped. It does not open the record page's conflict-compare dialog: the move is one field the reader can press again on the record as it now stands.
  3. The shared collector skips types with no in-place editor (rich text, file, formula). The stage menu therefore stops asking for them and falls through to the server's refusal, as card item 6 says for every surface.

Platform checklist: no clause moves.

Tests

Migrated: ui/packages/plugin-detail/src/__tests__/RecordStageMenu-35891.test.tsx. The stage menu's dialog is now role="dialog" (the shared Dialog), not alertdialog, and its rows are data-required-fields-field / data-required-fields-error instead of data-stage-change-field*. The rest is unchanged. One assertion moved: "left empty, the server refusal names the field" now first meets the shared dialog's own presence check ("Required", nothing written). The server refusal under the field is then asserted after a value is typed. The record:path control (alertdialog, Cancel focused) is untouched.

New:

  • RecordStageMenu-35891.test.tsx, #35956 the stage menu opens the shared fill-in dialog (7 tests):
    • it is the shared dialog, with the record name and the read-only stage row and no old form;
    • a stage that needs nothing opens the same dialog with no rows;
    • a chained field joins and Move waits for it, then sends one update { stage, loss_reason, loss_detail } with ifMatch;
    • control: a required rich-text field is not asked, and its refusal reads at the foot;
    • a 409 keeps the dialog and the typed value, re-reads, and says so at the foot;
    • a permission refusal reads the stage line, not the raw 403;
    • Cancel writes nothing and the next pick starts empty.
  • ui/packages/fields/src/__tests__/RequiredFieldsDialog.inPlace-35956.test.tsx (2 tests): with nothing to fill, the submit button is focused and submits {}; control: with a field, that field is focused.

Ablation (on committed code, each restored with git checkout --, git diff empty afterwards):

  • the dialog's no-field focus branch disabled (if (true || …) return) → 2 failed: the new fields test, and the stage menu's "Enter confirms the stage it names". Restored → green.
  • the stage menu's fillable forced false (nothing is ever asked) → 7 failed / 22 in RecordStageMenu-35891. Restored → green.
  • the field-scoped refusal no longer handed to the dialog as it came (if (false) throw err) → 2 failed / 22. Restored → green.
  • Seen during ablation, not a defect: fields={[]} alone keeps the suite green. The dialog's moreFields re-collects against the stored record and finds the same fields. The fillable ablation above is the one that removes the asking.

Verification

Local runs
  • vitest from ui/, one package at a time, on 5e61f1e9:

    • fields: 316 files, 4748 tests passed (1 file skipped);
    • plugin-detail: 396 files, 3643 tests passed (1 skipped);
    • plugin-kanban plus plugin-grid's ObjectGrid.requiredPrompt-35956: 82 files, 546 tests.

    On 0477e86e (test-only commit): the two changed files, 29/29.

  • tsc --noEmit for @object-ui/plugin-detail and @object-ui/fields: clean. eslint on the changed files: 0 errors. The 9 no-explicit-any warnings are on lines this PR did not touch.

  • Clause-② no: no export added, removed or retyped. RecordStageMenuProps, useStageChange's signature and StageChange, and RequiredFieldsDialogProps are unchanged. StageTarget is module-private.

  • node scripts/pm/overlap-check.mjs: VERDICT clean (main 9a98a467, 0 open PR heads share a file).

  • Changed lines: 6 files, +379 / −217, under the 3000 threshold.

Browser

Setup:

  • Server: examples/app-showcase, objectstack dev --seed-admin -p 43956 on its own temp DB.
  • UI: the ui/apps/console Vite dev server over it (workspace sources).
  • Browser: headless Chromium, zh-CN; light 1600×1000, dark 1600×1000, light 375×812.
  • Probe fields: no shipped object declares requiredWhen, so for the run only showcase_project gained PR 1's three probe fields (not committed): completion_note required on 已完成, follow_up required when the note is partial, rich-text cancel_memo required on 已取消.

Before (main 9a98a467's two files restored for the run): on 「Website Relaunch」 (进行中), the tag's menu → 已完成 opens the menu's own form 「更改阶段? 改为已完成前,请先填写: Completion Note*」. It shows no record name and no change row. Move with the field empty sends PATCH {"status":"completed"} → 400 「Completion Note不能为空」, which then shows under the field.

After (light; the same in dark on 「Data Platform」 and at 375 px):

  • 已完成 → 「更改阶段? | 改为已完成前,请先填写: | Website Relaunch | 状态: 已完成 | Completion Note*」. 0 writes. The first field is focused.
  • Move empty → 「必填」 under the field. 0 writes.
  • Type partial → 「Follow-up Owner*」 joins.
  • Cancel → 0 writes. The tag still reads 进行中.
  • Fill both and press Move → one PATCH {"completion_note":"partial","follow_up":"ops@example.com","status":"completed"} with If-Match → 200. The tag reads 已完成.
  • 进行中 (nothing to fill) → the same dialog with 「将此记录移至进行中? | Website Relaunch | 状态: 进行中」 and 「移动」 focused. Enter → PATCH {"status":"active"} → 200.
  • 已取消 (the required field is rich text) → no row. Move → PATCH {"status":"cancelled"} → 400. The dialog stays with 「Cancel Memo: Cancel Memo不能为空」 at its foot, and the tag still reads 进行中.
  • 375 px: the dialog fits the screen and its buttons stack.

Screenshots and journey logs are with the seat. Not measured: Safari / WebKit (no WebKit build in the container).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (eslint on the changed files: 0 errors)
  • 4. One issue, one branch off an up-to-date main, one pull request. (The branch is the platform-assigned claude/project-thread-9k8n3l, named in the claim.)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (the 维护者速读 block and the quoted UI strings are Chinese by the maintainer's standing rule)
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgWV6ouxRg2fByapa6F

…fill-in dialog

The stage menu beside the record's name now judges which fields a stage
makes required with `collectRequiredWhenPromptFields` and collects them in
`RequiredFieldsDialog` from `@object-ui/fields`, the pair the list cell,
the record page's inline Save and the kanban drop use. Its own pre-check
(`fieldsNeededAt`), field form and `confirmWithFields` in
`recordPathStageChange.tsx` are deleted. A stage that needs nothing opens
the same dialog as the move's confirmation; the dialog focuses its submit
button when it shows no field, so Enter still confirms. `record:path`
keeps its plain confirmation.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgWV6ouxRg2fByapa6F
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 21, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U

席位核对 — ACCEPT (L1-a)

维护者速读

这个 PR 是「补填必填字段」的最后一步:把记录页头部的阶段下拉也换成和列表、记录页行内保存、看板同一个补填框,原来那份自带的判断和表单删掉了。现在仓库里只剩一份判断、一个框。

我核过以下几点:

  • 删掉的代码确实只属于阶段菜单。
  • 记录页阶段条的确认框没有被改动。
  • 共享框里新加的一处行为(没有要补的字段时,焦点放在「移动」按钮上,按回车就确认)只影响阶段菜单,不影响其他用到这个框的地方。
  • 头部菜单读的是整条记录,不会碰到上一轮列表那种「只取了部分列」的问题。

没有需要修的问题。有一个小问题记在下面,供以后跟进。这个 PR 不属于受管面,不需要 L2,可以按普通队列合并,合并后卡 #35956 关闭。

Head reviewed: 0477e86e3dcc3c481c4e917440d92788359dbc49. Two commits, 6 files, +379/−217. git merge-tree onto current main is clean. check-governed-merges --pr 36032 (PR-head register) reads NOT governed. reviewFace with Clause-②: no gives face declaration → TIER_DEFAULT. The seat's claim names no L2 for this face. CI is as the thread reported (all success). vitest was not run here (no node_modules).

What holds

  • The pre-check. fieldsNeededAt is now one call, collectRequiredWhenPromptFields(objectFields, record, { [statusField]: value }, { fillable }). It is the same evaluator and the same transition-gate call the deleted loop made (resolveFieldRuleState with name, stored record as previous). It adds the shared hasFieldEditWidget skip, which is reading 3 and card item 6.
    • fillable(name, def) keeps the old test exactly: not the stage field, not read-only, computed or system, and recordEdit granted. It now has InlineEditSaveBar's signature.
    • record is ctx.data, the record page's full read, so the projection trap of PR 1's M1 does not apply here.
  • Deleted code. confirmWithFields, the InlineFieldInput rows, data-stage-change-field* and the menu's own refusal routing are all removed. isMissingForRequired, resolveFieldRuleState, InlineFieldInput, enrichDetailField and Button are no longer imported. record:path (collectFields off) keeps its AlertDialog and its under-the-rail refusal; only the dead collectFields branches left that JSX.
  • The dialog wiring.
    • The dialog is key={String(stage.value)}, so each pick starts empty.
    • The change row carries the picked stage's label.
    • moreFields re-collects with exclude: [statusField].
    • refusalField requires an in-place editor and fillable.
    • labelOf returns undefined for the stage field and for undeclared names, so those lines read alone, as stageRefusalLines does.
    • The title, description and 移动 label are the menu's existing keys, so no string is added.
  • Refusal split in submitWithFields. A refusal that names fields and has no declaredUserMessage is rethrown as it came, so the dialog routes it per field, adds a fillable field, or reads it at the foot. Every other refusal (409, 403, external source) becomes the unchanged stageRefusalLines text at the dialog's foot, after a re-read on 409. The stage only moves after updateVia resolves.
  • RequiredFieldsDialog focus. onOpenAutoFocus focuses the submit button only when shown.length === 0; with fields, the default first-tabbable focus stands. shown includes moreFields({}), which re-collects the same set, so it matches the fields actually drawn. The other three hosts open it only with fields, so they are unaffected. This carries the 记录页默认页不再画阶段条和顶部关键字段条;阶段改成记录名旁的状态标签,点开下拉切换(图 41) #35891 "Enter confirms" contract over from the old AlertDialog.
  • Clause-② no is right. No export is added, removed or retyped. StageTarget is module-private, and RequiredFieldsDialogProps / useStageChange's signature are unchanged. patch on fields and plugin-detail is right.
  • Tests. The migrated assertions change only the role (dialog for alertdialog) and the data attributes. "Left empty" now meets the shared presence check before the server refusal, as stated. The ablations named in the body cover the focus branch, fillable and the field-scoped rethrow.

Nit (does not block)

  • N1: after a 409, the dialog keeps the fields it was opened with. submitWithFields re-reads the record on a concurrency refusal and keeps the dialog open (reading 2). But fields={stage.fields} was fixed when the stage was picked. If the other writer has just filled one of those fields, it stays in the dialog with the reader's typed value, and the next Move overwrites what was just written. moreFields already re-collects against the refreshed record, and finds the field no longer missing. The old form had the same shape, so this is not a regression.
    • A small follow-up: re-derive target.fields from the refreshed record after the 409's refresh, or drop rows whose stored value is now present. PR 1's record-page inline Save routes the same case to the compare dialog instead, so the two record-page surfaces differ here. That difference is reading 2, declared; I am not asking to change it.

Observations (no change asked)

  • Rich-text, file and formula fields. The stage menu no longer asks for these. The refusal reads at the dialog's foot and the reader finishes the field on the record (reading 3). Users who could type a required rich-text reason into the old form lose that path. That is what card item 6 asks for on every surface.

Landing terms

  • Not governed: the seat lands it through the ordinary queue. Fixes #35956 closes the card on merge.
  • A new push needs a delta L1 unless it is a clean main merge.
  • This review does not approve, mark ready, enqueue or request review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob

Seat landing · 2026-11-21T09:29Z · The b1-CX card thread's PR 2 of #35956: the record header's stage menu now uses the shared required-field prediction and fill-in dialog (collectRequiredWhenPromptFields and RequiredFieldsDialog from @object-ui/fields), so one prediction and one fill-in dialog are left in the repo, as the card's acceptance asks. With nothing to fill in, the dialog shows the record, the stage and the move button, and focuses the button. A server 409 keeps the stage menu's note-and-re-read. Clause-②: no: no export added, removed or retyped, no i18n key; no L2 owed. L1-a ACCEPT 7060596963 on 0477e86e (this head). check-governed-merges --pr 36032 reads NOT governed (+379/−217). landing-k was not needed: the seat read K by hand, 4 since the merge base, under 15, and main since then touches neither translations/ nor skills/. On this head, 44 check-runs are success, 13 are skipped and none failed; mergeable clean. One nit stays as a follow-up card, not in this PR: after a 409 the dialog keeps the fields chosen when the stage was picked, so a value the other writer just filled can be overwritten by the next move. The old form did the same, so it is not a regression. The seat readies this PR and arms auto-merge in the same step. The PR carries Fixes #35956.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 21, 2026 09:29
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit 96b66ca Nov 21, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-9k8n3l branch November 21, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants